package com.sumainfor.zuul.service.impl;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.zuul.dao.ZxZuulMapper;
import com.sumainfor.zuul.service.ZxZuulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

@Service
public class ZxZuulServiceImpl implements ZxZuulService {

    @Autowired
    private ZxZuulMapper zxZuulMapper;
    /**
     *租后主管分配管家时查询租后主管所在的服务中心下的所有服务管家
     */
    @Override
    public List<Map<String, Object>> getButlerUserIdList(Map<String, Object> params) {
        return zxZuulMapper.getButlerUserIdList(params);
    }
    /**
     * 根据用户的编号查询用户的角色信息
     */
    @Override
    public Map<String, Object> getUserRoleInfo(Map<String, Object> params) {
        return zxZuulMapper.getUserRoleInfo(params);
    }
    /*
     *查询所有服务中心
     */
    @Override
    public List<Map<String, Object>> getDeptListByType(Map<String, Object> params) {
        return zxZuulMapper.getDeptListByType(params);
    }
    /**
     * 根据公司编号查询公司所在是市编号
     */
    public Map<String,Object> getSysArea(Map<String,Object> params){
        return zxZuulMapper.getSysArea(params);
    }
    /**
     * 根据公司编号查询支付信息
     */
    @Override
    public List<Map<String, Object>> getTransferInfoList(Map<String, Object> params) {
        return zxZuulMapper.getTransferInfoList(params);
    }
    /**
     * 工程经理查询某个服务中心下的维修师傅
     */
    public List<Map<String,Object>> getEnUserIdList(Map<String,Object> params){
        return zxZuulMapper.getEnUserIdList(params);
    }
    /**
     *根据手机号或姓名查询员工的信息（服务管家给维修师傅发送临时密码、运营助理给员工发送临时密码）
     */
    @Override
    public JsonResult getStaffList(Map<String, Object> params) {
        JsonResult result=new JsonResult();
        //根据手机号或姓名查询员工的信息
        List<Map<String,Object>> list=zxZuulMapper.getStaffList(params);
        if (list!=null){
            result.put(list);
        }else{
            result.putFailed("服务器繁忙");
        }
        return result;
    }
}
